package com.ganwei.springcloud.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 *
 * @author 26782
 */
@Configuration
public class GateWayConfig {

    @Bean
    public RouteLocator customRouteLocator(RouteLocatorBuilder routeLocatorBuilder){
        RouteLocatorBuilder.Builder routes = routeLocatorBuilder.routes();

        routes.route("path_rouch_ganwei",
                r -> r.path("/guonei").
                        uri("https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-consul-discovery/2.2.4.RELEASE")).build();
        return routes.build();
    }
}
